package com.wjr.entity;

import java.awt.*;

/**
 * 游戏中所有元素的父类
 */
public abstract class GameObject {
    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getLive() {
        return isLive;
    }

    public void setLive(Boolean live) {
        isLive = live;
    }

    //元素出现在窗口的坐标
    public int x,y;

    //元素的大小
    public int width,height;

    //元素名
    public String name;

    //元素状态
    public Boolean isLive;

    //画出自己的抽象方法
    public abstract void drawMe(Graphics graphics);

    //碰撞检测
    public abstract Rectangle getRectangle();
}
